home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / tcoop10a.zip / DOC.ZIP / RECT.DOC < prev    next >
Text File  |  1991-11-20  |  4KB  |  89 lines

  1. RECT.DOC        11/15/91        Copyright (c) 1991 by James S. Clark
  2. ==========================================================================
  3. RECT
  4. Rectangle Class
  5. --------------------------------------------------------------------------
  6. Class Name                      Rect
  7. Superclass                      <none>
  8. Category                        Graphics
  9. Other classes referenced        Point
  10. Other catagories referenced     <none>
  11. Used by                         <none>
  12. Inherited by                    <none>
  13.  
  14. Declaration                     Rect    *r = new Rect(x1, y1, x2, y2);
  15. Instance Variables
  16.                                 Point   upperleft;
  17.                                 Point   lowerright;
  18. Instance Methods
  19.                                 Rect    (int x1 = 0, int y1 = 0,
  20.                                          int x2 = 0, int y2 = 0);
  21.                                 Rect    (Point *ul, Point *lr);
  22.                                 Point   extent  ();
  23.                                 void    inset   (int , int );
  24.                                 void    offset  (int , int );
  25.                                 Point   origin  ();
  26.                                 void    set     (int , int , int , int );
  27. operators                       Rect&   operator = (const Rect& r);
  28.                                 Rect&   operator + (const Rect& r);
  29. --------------------------------------------------------------------------
  30. GENERAL DESCRIPTION
  31.  
  32. Rect provides a class for working with rectangular areas of the screen.
  33. Rectangles can be moved with the offset method, made bigger and smaller
  34. with the inset method, copied with the = operator, and added by using the
  35. + operator.
  36.  
  37. --------------------------------------------------------------------------
  38. VARIABLES
  39.  
  40. Point   upperleft;
  41.         This is the upper left corner of the rectangle.  It can be
  42.         accessed with the origin method.
  43.  
  44. Point   lowerright;
  45.         This is the lower right corner of the rectangle.  It can be
  46.         accessed with the extent method.
  47.  
  48. --------------------------------------------------------------------------
  49. METHODS
  50.  
  51. Rect    (int x1 = 0, int y1 = 0, int x2 = 0, int y2 = 0);
  52.         Create a new instance of a rectangle with the coordinates as given.
  53.         The default coordinates are (0, 0, 0, 0).
  54.  
  55. Rect    (Point *ul, Point *lr);
  56.         Create a new instance of a rectangle with the corrdinates expressed
  57.         as two points.
  58.  
  59. Point   extent  ();
  60.         This method returns the lowerright Point of the rectangle.
  61.  
  62. void    inset   (int dx, int dy);
  63.         Inset will increase of decrease the size of a rectangle according
  64.         to the x and y delta values entered.  Negative values will cause
  65.         the rectangle to get smaller.
  66.  
  67. void    offset  (int dx, int dy);
  68.         The offset method will cause the rectangles coordinates to be
  69.         shifted according to the x and y delta values entered.  The effect
  70.         is that of adding the values to the rectangles x and y coordinates.
  71.  
  72. Point   origin  ();
  73.         The method returns the upperleft Point of the rectangle.
  74.  
  75. void    set     (int , int , int , int );
  76.         Set allows you the change the coordinates of an existing rectangle.
  77.  
  78. Rect&   operator = (const Rect& r);
  79.         The = operator copies the contents of one rectangle into another.
  80.  
  81. Rect&   operator + (const Rect& r);
  82.         The + operator adds the coordinates of one rectangle to another and
  83.         leaves the results in the rectangle on the left side of the +.  The
  84.         effect is identical to the offset method.
  85.  
  86. --------------------------------------------------------------------------
  87. RECT.DOC                        Copyright (c) 1991 by James S. Clark
  88. ==========================================================================
  89.